package cloud.take.off.module.order.entity;

import cloud.take.off.mybatis.base.BaseEntity;
import cloud.take.off.utils.DateUtil;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description: TODO
 * @Author: Take-off
 * @Date: 2024/10/9 10:35 AM
 * @Param
 * @return
 * @Version: 1.0
 **/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "base_order")
@ApiModel(value = "BaseOrder 对象", description = "基础订单")
public class BaseOrder extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户Id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    @ApiModelProperty(value = "下单时间")
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME, timezone = "Asia/Shanghai")
    private Date orderDate;

    @ApiModelProperty(value = "订单金额")
    private BigDecimal totalAmount;
}
